package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
@TableName("t_reply")
public class ReplyBean {
    @TableId(value = "pk_replyID",type = IdType.AUTO)
    private Integer id;
    @TableField("r_title")
    private String title;
    @TableField("r_content")
    private String content;
    @TableField("r_date")
    private LocalDate date = LocalDate.now();
    @TableField("fk_userID")
    private Integer userID;
    @TableField(exist = false)
    private UserBean userBean;
    @TableField("fk_mainPostID")
    private Integer mainPostID;
    @TableField(exist = false)
    private MainPostBean mainPostBean;

    public ReplyBean() {
    }

    public ReplyBean(String title, String content, Integer userID, Integer mainPostID) {
        this.title = title;
        this.content = content;
        this.userID = userID;
        this.mainPostID = mainPostID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getUserID() {
        return userID;
    }

    public void setUserID(Integer userID) {
        this.userID = userID;
    }

    public Integer getMainPostID() {
        return mainPostID;
    }

    public void setMainPostID(Integer mainPostID) {
        this.mainPostID = mainPostID;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public MainPostBean getMainPostBean() {
        return mainPostBean;
    }

    public void setMainPostBean(MainPostBean mainPostBean) {
        this.mainPostBean = mainPostBean;
    }

    @Override
    public String toString() {
        return "\nReplyBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", userID=" + userID +
                ", userBean=" + userBean +
                ", mainPostID=" + mainPostID +
                ", mainPostBean=" + mainPostBean +
                '}';
    }
}
